home *** CD-ROM | disk | FTP | other *** search
/ Asymetrix Multimedia Creative Suite / Asymetrix Multimedia Creative Suite.iso / dvp / vfw11rt / setup.mst < prev    next >
Text File  |  1995-03-15  |  11KB  |  293 lines

  1. '**************************************************************************
  2. '*                  VfW 1.1d Runtime Setup
  3. '*    JohnT - 11/15/94: added Brad's code to short-circuit restarting Windows.
  4. '**************************************************************************
  5. '$INCLUDE 'setupapi.inc'
  6. '$INCLUDE 'mscpydis.inc'    ''System
  7. '$INCLUDE 'msdetect.inc'    ''Detects Avalilable Disk Space
  8.  
  9. ''Dialog ID's
  10. CONST WELCOME       = 100
  11. CONST ASKQUIT       = 200
  12. CONST EXITFAILURE   = 400
  13. CONST EXITQUIT      = 600
  14. CONST EXITSUCCESS   = 700
  15. CONST APPHELP       = 900
  16. CONST CHECK         = 2500
  17. CONST SMALLWIN      = 2200
  18. CONST RESTART       = 2600
  19. CONST RESTARTII     = 2700
  20.  
  21. ''Bitmap ID
  22. CONST LOGO = 1
  23.  
  24. GLOBAL SizeReq&  '' Total Disk Size required for installation
  25.  
  26. ''File Types
  27. GLOBAL WinDir$
  28. GLOBAL WinSysDir$
  29. GLOBAL WinSys32Dir$
  30. GLOBAL WINDRIVE$    ''Windows Drive Letter.
  31. GLOBAL CHECKSTATES$
  32. GLOBAL MinorVer%
  33. GLOBAL OnNT$
  34.  
  35. DECLARE SUB Install
  36. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  37. DECLARE FUNCTION OnWindowsNT LIB "INIUPD.DLL" AS INTEGER
  38. DECLARE FUNCTION VflatdPresent LIB "iniupd.DLL" AS INTEGER
  39. DECLARE SUB Reboot LIB "iniupd.dll"
  40. DECLARE fUNCTION ExitWindowsExec  LIB "User" (Exec$, Param$) AS INTEGER
  41.  
  42. INIT:
  43.   
  44.     CUIDLL$ = "mscuistf.dll"
  45.     HELPPROC$ = "FHelpDlgProc"
  46.     
  47.     WIN32ENABLED% = 0
  48.     MajorVer% = GetWindowsMajorVersion()
  49.     MinorVer% = GetWindowsMinorVersion()
  50.     Processor% = GetProcessorType()
  51.     WinDir$ = GetWindowsDir()
  52.     DEST$ = GetWindowsDir()
  53.     WinSysDir$ = GetWindowsSysDir()
  54.     WinSys32Dir$ = WinDir$ + "system32"
  55.  
  56.     IF MajorVer% < 3 OR (MajorVer% = 3 AND MinorVer% < 10) THEN
  57.     i% = DoMsgBox("Microsoft Windows version 3.10 or greater is required for this software.  Please upgrade your version of Windows.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  58.     END
  59.     END IF
  60.  
  61.     IF Processor% < 3 THEN
  62.     i% = DoMsgBox("Video for Windows requires a 386 or greater processor or emulator.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  63.     END
  64.     END IF
  65.  
  66.     IF OnWindowsNT() THEN
  67.       OnNT$ = "TRUE"
  68.       WowVersion$ = GetVersionOfFile(WinSys32Dir$ + "\wowexec.exe")
  69.       IF WowVersion$ = "" THEN
  70.          i% = DoMsgBox("Video for Windows does not run on Windows NT 3.1.  Please upgrade your version of Windows.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  71.          END
  72.       END IF
  73.     END IF
  74.  
  75.     SetBitmap CUIDLL$, LOGO
  76.     SetTitle "Video for Windows 1.1d Runtime"
  77.  
  78.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  79.     IF szInf$ = "" THEN
  80.        szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF"
  81.     END IF
  82.     ReadInfFile szInf$
  83.  
  84.     WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
  85.  
  86. WELCOME:
  87.     sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
  88.     IF sz$ = "CONTINUE" THEN
  89.        UIPop 1
  90.      ELSE
  91.     GOSUB ASKQUIT
  92.     GOTO WELCOME
  93.     END IF
  94.  
  95.     ClearCopyList
  96.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  97.  
  98.     IF ((NOT OnNT$ = "TRUE") AND MinorVer% < 50) THEN
  99.     AddSectionFilesToCopyList "MPlayer", SrcDir$, WinDir$
  100.     AddSectionFilesToCopyList "OLE2", SrcDir$, WinSysDir$
  101.     END IF
  102.     AddSectionFilesToCopyList "VfW Runtime", SrcDir$, WinSysDir$
  103.     AddSectionFilesToCopyList "ACM Drivers", SrcDir$, WinSysDir$
  104.     AddSectionFilesToCopyList "AVICodecs", SrcDir$, WinSysDir$
  105.     IF OnNT$ = "TRUE" THEN
  106.     AddSectionFilesToCopyList "NT MSVideo", SrcDir$, WinSys32Dir$
  107.     ENDIF
  108. ''*************************************************************************************************************************
  109. ''To add a DCI provider, please un-comment the AddSectionFilesToCopyList,
  110. ''and add a "DCI Provider" section with to the SETUP.INF file.
  111. ''
  112. ''    AddSectionFilesToCopyList "DCI Provider", SrcDir$, WinSysDir$
  113. ''*************************************************************************************************************************
  114.  
  115. ''  Check windrive diskspace
  116.     SizeReq& = GetCopyListCost ("","", "")
  117.     IF SizeReq& <> 0 THEN
  118.     GOSUB SMALLWIN
  119.     END
  120.     END IF
  121.  
  122. Install
  123.  
  124. '' *** Running from another Install, just inform user to restart Windows before running DVP then terminate
  125. i% = DoMsgBox("Video For Windows installation is complete.  Restart Windows before running this application.", "VFW Setup", MB_OK+MB_TASKMODAL+MB_ICONINFORMATION)
  126.  
  127. ''and then quit to return to main installation program
  128. END
  129.  
  130. '' Restart Windows: if it has to updates ACM from DOS, it restarts Windows automatically
  131. '' else, it gives the user the choice
  132.     RESTRT% = RestartListEmpty ()
  133.     Exe$ = DEST$ + "\_msrstrt.exe"
  134.     Batch$ = DEST$ + "\_mssetup.bat"
  135.     empty$ = ""
  136. RESTART:
  137.     IF RESTRT% = 0 THEN
  138.        sz$ = UIStartDlg(CUIDLL$, RESTART, "FInfo0DlgProc", 0, "")
  139.        IF sz$ = "REACTIVATE" THEN
  140.       GOTO RESTART
  141.        ENDIF
  142.        I% = ExitExecRestart ()
  143.        RemoveFile Exe$, cmoForce
  144.        RemoveFile Batch$, cmoForce
  145.        END
  146.     ELSE
  147.        sz$ = UIStartDlg(CUIDLL$, RESTARTII, "FQuitDlgProc", 0, "")
  148.        IF sz$ = "CONTINUE" THEN
  149.       I% = ExitWindowsExec (Exe$, empty$)
  150.       IF I% = 0 THEN
  151.          GOTO RESTART
  152.       ELSE
  153.          END
  154.      ENDIF
  155.        ELSEIF sz$ = "EXIT" THEN
  156.       UIPopAll
  157.       END
  158.        ELSEIF sz$ = "REACTIVATE" THEN
  159.       GOTO RESTART
  160.        ELSE
  161.       UIPop 1
  162.        END IF
  163.     END IF
  164.  
  165.  
  166. QUIT:
  167.     ON ERROR GOTO ERRQUIT
  168.  
  169.     IF ERR = 0 THEN
  170.     dlg% = EXITSUCCESS
  171.     ELSEIF ERR = STFQUIT THEN
  172.     dlg% = EXITQUIT
  173.     ELSE
  174.     dlg% = EXITFAILURE
  175.     END IF
  176. QUITL1:
  177.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  178.     IF sz$ = "REACTIVATE" THEN
  179.     GOTO QUITL1
  180.     END IF
  181.     UIPop 1
  182.     END
  183.  
  184. ERRQUIT:
  185.     i% = DoMsgBox("An installation problem occured, call the product support service", "Setup Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  186.     END
  187.  
  188.  
  189. ASKQUIT:
  190.     sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  191.  
  192.     IF sz$ = "EXIT" THEN
  193.     UIPopAll
  194. ''        ERROR STFQUIT
  195.     END
  196.     ELSEIF sz$ = "REACTIVATE" THEN
  197.     GOTO ASKQUIT
  198.     ELSE
  199.     UIPop 1
  200.     END IF
  201.     RETURN
  202.  
  203. SMALLWIN:
  204.     sz$ = UIStartDlg(CUIDLL$, SMALLWIN, "FInfo0DlgProc", 0, "")
  205.     IF sz$ = "REACTIVATE" THEN
  206.     GOTO SMALLWIN
  207.     END IF
  208.     UIPop 1
  209.     RETURN
  210.  
  211. '**
  212. '** Purpose:
  213. '**     Performs all installation operations.
  214. '** Arguments:
  215. '**     none.
  216. '** Returns:
  217. '**     none.
  218. '*************************************************************************
  219. SUB Install STATIC
  220.  
  221.     SetRestartDir WinDir$
  222.     CopyFilesInCopyList
  223.  
  224. ''Updating WIN.INI and SYSTEM.INI
  225. ''Only update SYSTEM.INI  on NT or next version of Windows for other codecs
  226.  
  227. IF ((NOT OnNT$ = "TRUE") AND MinorVer% < 50) THEN
  228.     IF VflatdPresent() = 0 THEN
  229.        CreateSysIniKeyValue WinDir$ + "system.ini", "386Enh", "device", "dva.386", cmoOverwrite
  230.     END IF
  231. END IF
  232.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV32", "ir32.dll", cmoOverwrite
  233.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV31", "ir32.dll", cmoOverwrite
  234.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.RT21", "ir21.dll", cmoOverwrite
  235.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.YVU9", "iyvu9.dll", cmoOverwrite
  236.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.CVID", "iccvid.drv", cmoOverwrite
  237.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MSVC", "msvidc.drv", cmoOverwrite
  238.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MRLE", "MSRLE.drv", cmoOverwrite
  239.     CreateIniKeyValue WinDir$ + "WIN.INI", "mci extensions", "avi", "AVIVideo", cmoOverwrite
  240.     CreateIniKeyValue WinDir$ + "system.ini", "mci", "AVIVideo", "mciavi.drv", cmoOverwrite
  241.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "WaveMapper", "msacm.drv", cmoOverwrite
  242.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.msadpcm", "msadpcm.acm", cmoOverwrite
  243.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.imaadpcm", "imaadpcm.acm", cmoOverwrite
  244.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "ir21.dll", "Intel Indeo(TM) Video R2.1", cmoOverwrite
  245.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msacm.drv", "Microsoft Soun